package com.example.demo_01.service.impl;

import com.example.demo_01.mapper.AdminMapper;
import com.example.demo_01.service.AdminService;
import com.example.demo_01.util.ResultBean;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public ResultBean checkAdmin(Map<String,String> map) {
        Map map1 = adminMapper.login(map);
        if(map1!=null) {
            return ResultBean.getInstance().success().setData(map1);
        }
        return ResultBean.getInstance().fail("账号密码有误!");
    }
}
